#include<iostream>
#ifndef __hhxxttxs_STUDENT__
#define __hhxxttxs_STUDENT__

class Student{
private:
    int std_no;
    //Student number.It's unique for different students.
    char major;
    //Student's major, which is marked by one character.
    //M for math; P for physics; C for computer;
    double GPA;
    //Something useless. But everyone must fight for it.
    //Range from 0 to 5. 0 means GUAKE and 5 means DALAO.
public:
    void setup_num (int num){std_no=num;}
    void setup_maj (char maj){major=maj;}
    void setup_gpa (double gpa){GPA=gpa;}
    void print(){std::cout <<major<<", "<<std_no<<", "<<GPA<<std::endl;}
    char out_maj (){return major;}
    int out_num(){return std_no;}
    double out_gpa(){return GPA;}
};

class heap {
private:
    int *data;
    int length;
public:
#define PARENT(i) ((((i)+1) >> 1) - 1)
#define LEFTCHILD(i) ((((i)+1) << 1) - 1)
#define RIGHTCHILD(i) (((i)+1) << 1)
    int get_length();
    int get_height();
    heap(Student *arr, int l);
    heap();
    ~heap();
    bool is_empty();
    int printout(Student *arr);
    int sort(Student *arr);
    int shiftdown(Student *arr, int i);
};

class merge{
    private:
    int length;
    public:
    merge(Student *arr,int l);
    merge();
    int sort(Student *arr, int n1, int n2);
    int unify(Student *arr,int left, int right, int centre);
};

#else
//DO NOTHING!
#endif